<!DOCTYPE html>
<html>
<head>
<link href="css/modern.css" rel="stylesheet"> 
<link href="css/style-student-group.css" rel="stylesheet" type="text/css">
</head>
	<%
		String courseNumber = (String) request.getAttribute("courseNumber");
		String sectionNumber = (String) request.getAttribute("sectionNumber");
		String firstname = (String) request.getAttribute("firstname");
		String lastname = (String) request.getAttribute("lastname");
		String isError = (String) request.getAttribute("isError");
	%>
<script>
function validateFiles()
{
	var studentFile = document.getElementsByName('studentList');
	//var TAFile = document.getElementsByName('TAList');
	
	var sValue = studentFile.value;
	var tValue = TAFile.value;
	
	if(sValue == null || sValue == "")
	{
		sValue = "blank";
		alert("Works");
		return false;
	}
	
	return true;
}
</script>

<body>

<div id="container">
	<div id="header"><br>
		<h1 id="main-title"><b><font color = "000000">EECE Student Group Assessments</b></font></h1>
	</div>
    <div id="body" align="left">
   		 <%if(isError.equals("true")) {%>
				<div class="error(info, warning)-bar" id="messageDialog" align="center"><br>
					<p><b><font color = "black">Failed to Add Class List! Make sure you uploaded a CSV format that follows the format indicated!</font></b></p>
				</div>
		<%}%>
        	<form id=form method="post" action="ProfBackCoursePortalServlet" >
             	<a href = "javascript:;" onclick="document.getElementById('form').submit();" class="back-button big page-back">
             		<input type = "hidden" name = "firstname" value = <%=firstname%>>
					<input type = "hidden" name = "lastname" value = <%=lastname%>>	
					<input type = "hidden" name = "courseNumber" value = "<%=courseNumber%>">
					<input type = "hidden" name = "sectionNumber" value = <%=sectionNumber%>>	
             	</a>
            </form>
        <div id="innerBody" class="page-region-content tiles" align = "center">
		<h2><font size ="18">Add Student List for <%=courseNumber%> Section <%=sectionNumber%></font></h2><br>
		<p><font size = "4">Please upload a CSV file.  The File MUST ONLY be in .CSV format and in the following format:</font></p><br>
		<p><font size = "4">Student Number, username, password, firstname, lastname, e-mail, program, year, GPA</font></p><br>
		<form name = "addList" id="addList" action = "ProfAddClassServlet" method = "post"  enctype="multipart/form-data">
			Student List:<input type="file" name="studentList"> 
			<br><br>
			<!--TA List:<input type="file"  name="TAList">-->
			<br><br>
			<input type="submit" value="Add Lists" onclick = "return validateFiles()"/>
			<input type = "hidden" name = "courseNumber" value = "<%=courseNumber%>">
			<input type = "hidden" name = "sectionNumber" value = <%=sectionNumber%>>	
			<input type = "hidden" name = "firstname" value = <%=firstname%>>
			<input type = "hidden" name = "lastname" value = <%=lastname%>>	
		</form> </font>
		</div>
	</div>
			<div id="footer">
			&copy;UBC Electrical and Computer Engineering. Styled with <a
				href="http://metroui.org.ua">Metro UI CSS</a>
		</div>
</div>
</body>
</html>